from sqlalchemy import Column, Integer, String, DateTime
from sqlalchemy.sql import func
from module_admin.entity.do.base import db


class Progress(db.Model):
    __tablename__ = 'sys_progress'

    # 表注释
    __table_args__ = {'comment': '学生进度表'}

    id = Column(Integer, primary_key=True, autoincrement=True, comment='进度ID')
    quiz_score = Column(Integer, nullable=True, comment='测验分数')
    time = Column(String(255), nullable=True, comment='测验时间')
    assignment_score = Column(Integer, nullable=True, comment='作业分数')
    student_name = Column(String(255), comment='学生名字')
    course_name = Column(String(255), comment='课程名字')
    file_id = Column(Integer, comment='文件id')
    # 自动创建时间
    created_at = Column(DateTime, default=func.now(), comment='记录创建时间')


class VideoProgress(db.Model):
    __tablename__ = 'sys_video_progress'

    # 表注释
    __table_args__ = {'comment': '视频进度表'}

    id = Column(Integer, primary_key=True, autoincrement=True, comment='进度ID')
    video_progress = Column(Integer, nullable=True, comment='视频进度')
    student_name = Column(String(255), comment='学生名字')
    file_name = Column(String(255), comment='课程名字')


class Score(db.Model):
    __tablename__ = 'sys_score'

    # 表注释
    __table_args__ = {'comment': '成绩表'}

    id = Column(Integer, primary_key=True, autoincrement=True, comment='ID')
    score = Column(Integer, nullable=True, comment='分数')
    student_name = Column(String(255), comment='学生名字')

